<%@page contentType="text/html; charset=UTF-8" %>
<div class="do"> &nbsp;&nbsp;&nbsp;第${pageInfo.pageNum}页 共${pageInfo.pages}页&nbsp;
    <button class="button2" type="button" id="firstPage">首页</button>
    <c:if test="${pageInfo.hasPreviousPage == true}">
        <button class="button2" type="button" id="prePage">上一页</button>
    </c:if>
    <c:if test="${pageInfo.hasNextPage == true}">
        <button class="button2" type="button" id="nextPage">下一页</button>
    </c:if>
    <button class="button2" type="button" id="lastPage">尾页</button>
    &nbsp;

    <input size="2" class="jump" align="absmiddle1()" class="defaultInputStyle"
           style="margin-left:1px;margin-right:1px" name="myformGOPAGE"
           onpropertychange="if(document.forms['myform'].myformGOPAGE2 &amp;&amp; document.forms['myform'].myformGOPAGE2.value!=document.forms['myform'].myformGOPAGE.value)document.forms['myform'].myformGOPAGE2.value=document.forms['myform'].myformGOPAGE.value;"
           value="" id="inputPage">
    页<button class="button2" type="button" id="jumpPage">转跳</button>
</div>
<script>
    $(function(){
        $("#firstPage").click(function(){
            jump(${pageInfo.firstPage});
        });
        $("#prePage").click(function(){
            jump(${pageInfo.prePage});
        });
        $("#nextPage").click(function(){
            jump(${pageInfo.nextPage});
        });
        $("#lastPage").click(function(){
            jump(${pageInfo.lastPage});
        });
        $("#jumpPage").click(function () {
            var page = $("#inputPage").val();
            var pattern = /^[0-9]*$/;
            if(pattern.test(page) == false || page == ""){
                alert("请输入正确的页数");
                $("#inputPage").val("");
                return ;
            }
            jump(page);
        });
    });

</script>
